#!/bin/bash

echo "------------------------ commit id ------------------------"
printf "%s$(git rev-parse HEAD) \n"

echo "------------------------ jar build ------------------------"
mvn --batch-mode --errors --fail-fast --threads 1C --projects "cn.huihe:demoai" --also-make clean package

IMAGE="yaolianhua/demoai:$(date '+%Y.%m.%d.%H%M%S')"

echo "------------------------ docker build ------------------------"
docker build -f Dockerfile -t "${IMAGE}" .

echo "------------------------ docker push ------------------------"
docker push "${IMAGE}"

